<?php
if(!defined('BLOG'))exit('不作死就不会死');
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/1/2
 * Time: 13:48
 */
class route{
    public function __construct(){
        $this->Get_M();
        $this->Get_C();
        $this->Get_A();
    }
    private function Get_M(){
        $module = isset($_GET['m'])?trim($_GET['m']):base::load_config('route','m');
        if(preg_match('/[^a-zA-Z_]+/',$module)){
            exit('The module does not exist');
        };
        define('R_M',$module);
    }
    private function Get_C(){
        $controller = isset($_GET['c'])?trim($_GET['c']):base::load_config('route','c');
        if(preg_match('/[^a-zA-Z_]+/',$controller)){
            exit('The controller does not exist');
        };
        define('R_C',$controller);
    }
    private function Get_A(){
        $action = isset($_GET['a'])?trim($_GET['a']):base::load_config('route','a');
        if(preg_match('/[^a-zA-Z_]+/',$action)){
            exit('The method does not exist');
        };
        define('R_A',$action);
    }

}